/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.entity;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alex
 */
@Entity
@Table(catalog = "", schema = "nasa")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Questionario.findAll", query = "SELECT q FROM Questionario q"),
    @NamedQuery(name = "Questionario.findByQuestId", query = "SELECT q FROM Questionario q WHERE q.questId = :questId"),
    @NamedQuery(name = "Questionario.findByQuestNome", query = "SELECT q FROM Questionario q WHERE q.questNome = :questNome"),
    @NamedQuery(name = "Questionario.findByQuestDescricao", query = "SELECT q FROM Questionario q WHERE q.questDescricao = :questDescricao")})
public class Questionario implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "quest_id", nullable = false)
    private Integer questId;
    @Basic(optional = false)
    @Column(name = "quest_nome", nullable = false, length = 45)
    private String questNome;
    @Column(name = "quest_descricao", length = 255)
    private String questDescricao;
//    @ManyToMany(mappedBy = "questionarioList")
//    private List<Grupo> grupoList;
//    @OneToMany(cascade = CascadeType.ALL, mappedBy = "resultQuestionario")
//    private List<Resultado> resultadoList;

    public Questionario() {
    }

    public Questionario(Integer questId) {
        this.questId = questId;
    }

    public Questionario(Integer questId, String questNome) {
        this.questId = questId;
        this.questNome = questNome;
    }

    public Integer getQuestId() {
        return questId;
    }

    public void setQuestId(Integer questId) {
        this.questId = questId;
    }

    public String getQuestNome() {
        return questNome;
    }

    public void setQuestNome(String questNome) {
        this.questNome = questNome;
    }

    public String getQuestDescricao() {
        return questDescricao;
    }

    public void setQuestDescricao(String questDescricao) {
        this.questDescricao = questDescricao;
    }

//    @XmlTransient
//    public List<Grupo> getGrupoList() {
//        return grupoList;
//    }
//
//    public void setGrupoList(List<Grupo> grupoList) {
//        this.grupoList = grupoList;
//    }
//
//    @XmlTransient
//    public List<Resultado> getResultadoList() {
//        return resultadoList;
//    }
//
//    public void setResultadoList(List<Resultado> resultadoList) {
//        this.resultadoList = resultadoList;
//    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (questId != null ? questId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Questionario)) {
            return false;
        }
        Questionario other = (Questionario) object;
        if ((this.questId == null && other.questId != null) || (this.questId != null && !this.questId.equals(other.questId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Questionario[ questId=" + questId + " ]";
    }
    
}
